<?php
class Home extends MY_Controller {
	private $news,$prosecond,$probelong;
	private $price;
 	function __construct()
 	{
 		parent::__construct();
		$this->load->helper('seo');
		$this->load->helper('strcut');
		$this->load->helper('url');
		$this->news =array(
				'' 			=> '请选择',
				'全新' 		=> '全新',
				'九成新' 		=> '九成新',
				'八成新' 		=> '八成新',
				'七成新' 		=> '七成新',
				'六成新' 		=> '六成新',
				'五成新' 		=> '五成新',
				'五成新以下' 	=> '五成新以下'
		);
 		$this->prosecond = array(
				'0'		=>'不限',
				'1' 	=>'二手',
				'2'		=>'全新'
		);
		$this->probelong = array(
				'0'		=>'不限',
				'1'		=>'个人',
				'2'		=>'公司'
		);
		$this->price	= array(
				'0'		=>'不限',
				'1'		=>'100元以下',
				'2'		=>'100-500元',
				'3'		=>'500-1000元',
				'4'		=>'1000-3000元',
				'5'		=>'3000-6000元',
				'6'		=>'6000-1万元',
				'7'		=>'1万元以上'
		);	
 	}
	
// ------------------------------------------------------------------------
/**
	* 网站首页
	*
*/	  
	function Index()
	{
		redirect('/home/slist/0');
		exit;
		$data =$this->data_config;
		$this->load->model('class_model');
		$tsort0 = $this->class_model->getsort('jiaju_class');
		$tsort  = $this->class_model->getsort2('jiaju_class',0);
		$fenlei = $this->class_model->getchildren($tsort,0,0);
		foreach($fenlei as $row):
			$re = $this->class_model->getsort2('jiaju_class',$row->classid);
			if( $re != false)
			{
				$row->fenlei1=$this->class_model->getchildren($this->class_model->getsort2('jiaju_class',$row->classid),$row->classid,0);
			}else
			{
				$row->fenlei1=false;
			}
		endforeach;
		$data['fenlei'] = $fenlei;
		$this->load->view('index_view',$data);
	}// end func
	

	// ------------------------------------------------------------------------
	/**
		* 取得家具分类的子ID集 对应的商品ID
		* return array
	*/
	public function getsonid_class($CatagoryID)
	{
		// 在 jiaju_class_catagory 有中找出class 集
		$this->load->model('sort_model');
		$this->sort_model->setfix('jiaju_class_');
		$classid = $this->sort_model->getsonid($CatagoryID);	
		// 在jiaju_pro_class	 表中找出产品id集
		$this->load->model('proclass_model');
		return $this->proclass_model->getproid($classid);
	}
	

	
	// ------------------------------------------------------------------------
	/**
		* 取得区域分类的子ID集
		* return array
	*/
	public function getsonid_area($CatagoryID)
	{
		$this->load->model('sort_model');
		$this->sort_model->setfix('jiaju_area_');
		return $this->sort_model->getsonid($CatagoryID);	
	
	}



function abc(){
	
	$this->mail_user(1,2,3,4,'263708155@qq.com');
}
// ------------------------------------------------------------------------
/**
	* 搜索、筛选结果页.
	*
*/
	public function slist($uri = '')
	{
		parse_str($_SERVER['QUERY_STRING'], $_GET);
		// 搜索条件
		$querystring =$_SERVER['QUERY_STRING'];
		if ($querystring !='') $querystring = '?'.$querystring;
		$arrWhere = array();
		
		// 性质 
		$prosecond 		= $this->input->get("prosecond");
		if($prosecond != "0") $arrWhere[] = "(prosecond=$prosecond)";
		// 价格
		$price 			= $this->input->get("price");
		/*		'1'		=>'100元以下',
				'2'		=>'100-500元',
				'3'		=>'500-1000元',
				'4'		=>'1000-3000元',
				'5'		=>'3000-6000元',
				'6'		=>'6000-1万元',
				'7'		=>'1万元以上'		*/
		if($price != "0"){
			switch($price)
			{
				case '1':
				$arrWhere[] = "(price<100)";
				break;
				case '2':
				$arrWhere[] = "(price BETWEEN 100 AND 500)";
				break;
				case '3':
				$arrWhere[] = "(price BETWEEN 500 AND 1000)";
				break;
				case '4':
				$arrWhere[] = "(price BETWEEN 1000 AND 3000)";
				break;
				case '5':
				$arrWhere[] = "(price BETWEEN 3000 AND 6000)";
				break;
				case '6':
				$arrWhere[] = "(price BETWEEN 6000 AND 10000)";
				break;
				case '7':
				$arrWhere[] = "(price>10000)";
				break;
				default:
				break;
			}
			
		}
		// 发布
		$probelong 		= $this->input->get("probelong");
		if($probelong != "0")  $arrWhere[]="probelong=$probelong";
		// 分类
		$classid 		= $this->input->get("classid");
		if($classid !="0"){
			$arrproid = $this->getsonid_class($classid);
			if (count($arrproid)>0)
			$arrWhere[] ="proid IN (" . implode(", ", $arrproid) . ") ";
			else // 制造一个不存在的条件
			$arrWhere[] = "proid = 'no'";
		}
		// 区域
		$proarea 		= $this->input->get("proarea");
		if($proarea!= "0" ){
			$arrarea = $this->getsonid_area($proarea);
			$arrWhere[] = "proarea IN (" . implode(", ", $arrarea) . ") ";
		}
		// 关键词
		$k 	= $this->input->get("k");
		if ($k != '0' && $k!=""){
			$arrWhere[] = "(proname Like '%$k%' OR onetel='$k')";
		}
		$arrWhere[] = "(prostate=0)"; // 上架的状态
		$sql =implode(" AND ", $arrWhere);
		$data =$this->data_config;
		$this->load->model('product_model');
		$this->load->helper('img');
		$this->load->library('paginationk');	//载入分页类
	 	// 参数BGGIN
		$config['base_url'] = $data['base_header']."/home/slist"; //分页url 
		$config['base_url2'] = $querystring;  
		//$data['count_all']=$config['total_rows'] = $this->product_model->getcountpro($k);//记录总数
		$data['count_all']=$config['total_rows'] = $this->product_model->getcountpro2($sql);//记录总数
		$config['per_page'] = '24';  	//每页显示数         
		$config['uri_segment'] = 3;    // 分页在第几个参数
		// 分页自定义参数
		$config['link_suffix']   ='.html';		// 链接结尾
		$config['full_tag_open'] = '<div id="page">';    
		$config['full_tag_close'] = '</div>';    
		$config['first_link'] = '首页';    
		$config['last_link'] = '尾页';//你希望在分页的右边显示“最后一页”链接的名字。    
		$config['next_link'] = '下一页';//你希望在分页中显示“下一页”链接的名字。    
		$config['prev_link'] = '上一页';//你希望在分页中显示“上一页”链接的名字。
	 	// 参数END
		 //载入参数
		$this->paginationk->initialize($config);       
		$this->db->where($sql);
		$this->db->order_by('update','desc');
		$list = $this->db->get("jiaju_product",$config['per_page'],$this->uri->segment(3)); 
		foreach($list->result() as $row) :
			$row->probelong1 = $this->probelong[$row->probelong];
			$row->update = date('Y-m-d',$row->update);
		endforeach;
		$data['listpro'] = $list;
		$data['k'] =$k;
		$data['page'] = $this->paginationk->create_links(); //输出分页
		$this->load->helper('box');
		$data['prosecond'] 	= $this->prosecond;
		$data['price'] 		= $this->price;
		$data['probelong'] 	= $this->probelong;
		
		$data['prosecond_S'] 	= $this->false_to0($prosecond);
		$data['price_S'] 		= $this->false_to0($price);
		$data['probelong_S'] 	= $this->false_to0($probelong);
		$data['classid_S'] 		= $this->false_to0($classid);
		$data['proarea_S'] 		= $this->false_to0($proarea);
		$this->load->view('slist_view',$data);
	}	
	

	// ------------------------------------------------------------------------
	/**
		* ajax 验证用户输入的管理密码是否正确
	*/
	public function userchkpwd()
	{
		$pwd 	= $this->input->post('pwd');
		$proid= $this->input->post('proid');
		$this	->load->model('product_model');
		if($this->product_model->userchkpwd($proid,$pwd) or ($pwd =='y'))
		{
			// 1 写入cookie cookie['usermodifydo'] 2 跳到修改页面
			$this->load->helper('cookie');
			$cookie = array(
                   'name'   => 'usermodifydo',
                   'value'  => $proid,
                   'expire' => '0',
               );
			set_cookie($cookie); 
			echo '1';
		}else{echo '0';	}
		

	}
	
	
	// ------------------------------------------------------------------------
	/**
		* 个人用户修改信息
		* 1判断cookie['usermodifydo']中是否有传过来的id，有就可以修改，没有就不能修改
		* 这个cookie 应该是个数组，然后判断这个id，是否存在数组中
		* 2否则就提示请输入管理密码，跳转到这个页面去
	*/
	public function usermodify($proid)
	{
		$this->load->helper('cookie');
		$udo = get_cookie('usermodifydo');
		if ($udo == $proid){
			$this->load->helper('form');
			$this->load->helper('exe');
			$this->load->helper('box');
			$data =$this->data_config;
			// 从数据读取用户信息 
			$this->load->helper('img');
			$this->load->model('product_model');
			$this->load->model('proclass_model');
			$this->load->model('class_model');
			$this->load->model('area_model');
			$tre = $this->product_model->onepro($proid);
			$arrclassid	=$this->proclass_model->getproclassid($proid);
			$classid = $arrclassid->classid;// 还没有考虑多个属于分类
			$classle =	$this->class_model->getclassle($classid);
			$data['classle'] = $classle;
			$areale = $this->area_model->getareale($tre->proarea);
			$data['areale'] = $areale;
			$data['classid']=$classid;
			$data['proinfo'] = $tre;
			$data['proid'] = $proid;
			$attributes = array('id'=>'userpub','name'=>'userpub');
			$data['formopenuser'] = form_open('home/dousermodify',$attributes);
			$data['formcloseuser'] = form_close();
			$data['userpubid'] = getid_exe('userpub');
			$js = 'id="news"';//几成新，js要验证
			$data['news'] = form_dropdown('news',$this->news,$tre->news,$js);
			$this->load->view('user/usermodify_view',$data);
		}
		else redirect('/home/notice/4');
	}
	

	// ------------------------------------------------------------------------
	/**
		* 个人用户修改处理
	*/
	public function dousermodify()
	{
		// 必须上传图片
		if($this->input->post('pic') =="")
		{
			$data =$this->data_config;
			header("location: ".$data['base_header']."/home/notice/1");
			exit;
		}
		
		$classid=$this->input->post('classid');// 入另外一个表【类别表】
		$proid = $this->input->post('proid');
		$vdata = array(
			// 表单提交数据
			'onecontact'		=>$this->input->post('onecontact'),
			'onetel'			=>$this->input->post('onetel'),
			'oneqq'				=>$this->input->post('oneqq'),
			'oneemail'			=>$this->input->post('oneemail'),
			'proname'			=>$this->input->post('proname'),
			'proarea'			=>$this->input->post('proarea'),
			'address'			=>$this->input->post('address'),
			'news'				=>$this->input->post('news'),
			'price'				=>$this->input->post('price'),
			'prodescription'	=>$this->input->post('prodescription'),
			'pic'				=>$this->input->post('pic'),
			'source'			=>$this->input->post('source'),
		);
		// 入jiaju_product表
		$this->load->model('product_model');
		$this->product_model->ProductUp($proid,$vdata);// 更新商品
		// 入jiaju_pro_clas 表
		$this->load->model('proclass_model');
		$cdata = array(
			'classid'		=> $classid
		);
		$this->proclass_model->ProclassUp($proid,$cdata);// 更新分类
		$data =$this->data_config;
		header("location: ".$data['base_header']."/home/notice/5/$proid");
	}
	
	
	// ------------------------------------------------------------------------
	/**
		* 个人删除信息 -   下架
	*/
	public function proDown($proid,$s)
	{
		// 权限判断
		$this->load->helper('cookie');
		$udo = get_cookie('usermodifydo');
		if ($udo == $proid){
			$vdata =array('prostate'=>$s);
			$this->load->model('product_model');
			$this->product_model->ProductUp($proid,$vdata);// 更新
			$data =$this->data_config;
			redirect("/home/notice/5/$proid");
		}else redirect('/home/notice/4');
	}// end func
	

	// ------------------------------------------------------------------------
	/**
		* 更新
	*/
	public function proFresh($proid)
	{
		
		// 权限判断
		$this->load->helper('cookie');
		$udo = get_cookie('usermodifydo');
		if ($udo == $proid){
			$data =$this->data_config;
			$this->load->model('product_model');
			$isok = $this->product_model->proFresh($proid);
			if ($isok>=1){
				redirect("/home/notice/5/$proid");
			}else{
				redirect("/home/notice/6/$proid");
			}
			
		}
		else redirect('/home/notice/4');
	}
	

	// ------------------------------------------------------------------------
	/*
		* 如果值为false 就返回0，否则返回本身
	*/
	function false_to0($var)	
	{
		if($var == false)	
		return 0;
		else
		return $var;
	}
	
	
// ------------------------------------------------------------------------
	/**
		* 弹出上传图片窗口
	*/
	public function upimg($taction='', $group='vUser')
	{
	
		if(! isset($_POST['orderid'])) exit('...');
		$data =$this->data_config;
		
		if(isset($_POST['str_pic_url']))
		{
			// 过滤回车换行
			$str_pic_url = $_POST['str_pic_url'];
			$str_pic_url = preg_replace("/[\n]/i","",$str_pic_url);
		}else $str_pic_url = '';
		
		/**
		 * 添加图片访问的基本路径
		 *
		 * @author add by Laurence.xu <haohailuo@163.com> at Sun Mar 13 11:14:10 CST 2011
		*/
		$base_picurl = '';
		if (isset($_POST['picurl'])) {
			$base_picurl = preg_replace("/[\n]/i", "", $_POST['picurl']);
		}
		//add end
		
		$data['str_pic_url']  = $str_pic_url;
		$data['taction'] = $taction;
		$data['base_picurl'] = $base_picurl;
		$data['pic_group'] = $group;
		$this->load->view('upimg_view',$data);
	
	}
	// ------------------------------------------------------------------------
	/**
		* 个人发布chkcode 检查验证码
	*/
	public function chkcode()
	{
		//if(! isset($_POST["chkcode"]))  exit('...');
		$this->load->library('session');
		$this->load->library('authcode');
		if($this->authcode->check($this->input->post('chkcode')))
		{echo 1;}
		else {echo 0;}
	}
	


	// ------------------------------------------------------------------------
	/**
		* 详细显示页入口
	*/
	public function show($probelong,$proid)
	{
		if($probelong==1){// 个人用户
			$this->usershow($proid);
		
		}else{
			$this->pv($proid);
		}
	}


// ------------------------------------------------------------------------

/**
	* 个人用户显示页面

*/
	public function usershow($proid)
	{

		$data =$this->data_config;
		$this->load->helper('img');
		$this->load->model('product_model');
		$this->load->model('proclass_model');
		$this->load->model('class_model');
		$this->load->model('area_model');
		if($this->product_model->proexist($proid) == false)
		{
			header("location: ".$data['base_url']."/404.php");
			exit;
		}
		
		$tre = $this->product_model->onepro($proid);

		$arrclassid	=$this->proclass_model->getproclassid($proid);
		$classid = $arrclassid->classid;// 还没有考虑多个属于分类
		$classle =	$this->class_model->getclassle($classid);
		$data['classle'] = $classle;
		$areale = $this->area_model->getareale($tre->proarea);
		$data['areale'] = $areale;
		if ( $tre != false)
		{
			$tre->datedesc=date("Y年m月d日",$tre->update);
			
			$tre->update=date("Y-m-d H:i:s",$tre->update);
			$tre->adddate=date("Y-m-d",$tre->adddate);
			$data['proinfo'] = $tre;
			$data['proid'] = $proid;
			$this->load->view('user/usershow_view',$data);
		}else{
			header("location: ".$data['base_url']."/404.php");	
		}
	}	
	

// ------------------------------------------------------------------------

/**
	* userpub
	*
	* 个人发布页面-Mark.
	*
	* @access	public
	* @param	string	the URL
	* @param	string	the link title
	* @param	mixed	any attributes
	* @return	string
*/
	public function userpub_mark($uri = '')
	{
		$this->load->helper('form');
		$this->load->helper('exe');
		$this->load->helper('box');
		$data =$this->data_config;
		$attributes = array('id'=>'userpub','name'=>'userpub');
		$data['formopenuser'] = form_open('home/useraddpro_mark',$attributes);
		$data['formcloseuser'] = form_close();
		$data['userpubid'] = getid_exe('userpub');
		$js = 'id="news"';
		$data['news'] = form_dropdown('news',$this->news,'',$js);
		$this->load->view('user/userpub_mark_view',$data);
	}	
	
	
	// ------------------------------------------------------------------------
	/**
		* userpub
		*
		* 个人发布页面.
		*
		* @access	public
		* @param	string	the URL
		* @param	string	the link title
		* @param	mixed	any attributes
		* @return	string
	*/
	public function userpub($uri = '')
	{
		$this->load->helper('form');
		$this->load->helper('exe');
		$this->load->helper('box');
		$data =$this->data_config;
		$attributes = array('id'=>'userpub','name'=>'userpub');
		$data['formopenuser'] = form_open('home/useraddpro',$attributes);
		$data['formcloseuser'] = form_close();
		$data['userpubid'] = getid_exe('userpub');
		$js = 'id="news"';
		$data['news'] = form_dropdown('news',$this->news,'',$js);
		$this->load->view('user/userpub_view',$data);
	}


	// ------------------------------------------------------------------------
	/**
		* 个人发布信息管理密码
	*/
	private function getonepwd($length=5)
	{
		$pattern = '0123456789';    //字符池
		$key = '';
		for($i=0;$i<$length;$i++)
		{
			$key .= $pattern{mt_rand(0,9)};    //生成php随机数
		}
		return $key;
	}

	
	// ------------------------------------------------------------------------
	/**
		* 个人发布入库_mark
	*/
	public function useraddpro_mark()
	{
		// 必须上传图片
		if($this->input->post('pic') =="")
		{
			$data =$this->data_config;
			header("location: ".$data['base_header']."/home/notice/1");
			exit;
		}
		
		
		$classid	=	$this->input->post('classid');// 入另外一个表【类别表】
		$onecontact = $this->input->post('onecontact');
		$proname 	= $this->input->post('proname');
		$onepwd		= $this->getonepwd();
		$oneemail	= $this->input->post('oneemail');
		$vdata = array(
			// 表单提交数据
			'onecontact'		=>$onecontact,
			'onetel'			=>$this->input->post('onetel'),
			'oneqq'				=>$this->input->post('oneqq'),
			'oneemail'			=>$oneemail,
			'proname'			=>$proname,
			'proarea'			=>$this->input->post('proarea'),
			'address'			=>$this->input->post('address'),
			'news'				=>$this->input->post('news'),
			'price'				=>$this->input->post('price'),
			'prodescription'	=>$this->input->post('prodescription'),
			'pic'				=>$this->input->post('pic'),
			'picpath'			=>$this->input->post('base_picurl'),
			'source'			=>$this->input->post('source'),
			// 系统添加数据
			'probelong '		=>1,		// 个人
			'prosecond'			=>1,		// 二手
			'adddate'			=>time(),	// 上架时间
			'update'			=>time(),	// 更新时间
			'times'				=>1,		// 浏览次数
			'onepwd'			=>$onepwd,	// 个人管理密码
			'verify'			=>1		// 0 表示未审核  1 表示已通过审核
		);
		// 入jiaju_product表
		$this->load->model('product_model');
		$proid = $this->product_model->Productadd($vdata);
		// 入jiaju_pro_clas 表
		$this->load->model('proclass_model');
		$cdata = array(
			'proid'			=> $proid,
			'classid'		=> $classid
		);
		$this->proclass_model->Proclassadd($cdata);
		// 发送邮件
		$prourl = $this->data_config['base_header']."/home/show/1/$proid.html";
		if ($oneemail != '405503525@qq.com')
		$this->mail_user($onecontact,$proname,$prourl,$onepwd,$oneemail);
//		else
//		$this->mail_user($onecontact,$proname,$prourl,$onepwd,'263708806@qq.com');
		$data =$this->data_config;
		redirect("/home/notice/3/$proid");
	}
	
		
	// ------------------------------------------------------------------------
	/**
		* 个人发布入库
	*/
	public function useraddpro()
	{
		// 必须上传图片
		if($this->input->post('pic') =="")
		{
			$data =$this->data_config;
			header("location: ".$data['base_header']."/home/notice/1");
			exit;
		}
		
		
		$classid	=	$this->input->post('classid');// 入另外一个表【类别表】
		$onecontact = $this->input->post('onecontact');
		$proname 	= $this->input->post('proname');
		$onepwd		= $this->getonepwd();
		$oneemail	= $this->input->post('oneemail');
		$vdata = array(
			// 表单提交数据
			'onecontact'		=>$onecontact,
			'onetel'			=>$this->input->post('onetel'),
			'oneqq'				=>$this->input->post('oneqq'),
			'oneemail'			=>$oneemail,
			'proname'			=>$proname,
			'proarea'			=>$this->input->post('proarea'),
			'address'			=>$this->input->post('address'),
			'news'				=>$this->input->post('news'),
			'price'				=>$this->input->post('price'),
			'prodescription'	=>$this->input->post('prodescription'),
			'pic'				=>$this->input->post('pic'),
			'picpath'			=>$this->input->post('base_picurl'),
			'source'			=>$this->input->post('source'),
			// 系统添加数据
			'probelong '		=>1,		// 个人
			'prosecond'			=>1,		// 二手
			'adddate'			=>time(),	// 上架时间
			'update'			=>time(),	// 更新时间
			'times'				=>1,		// 浏览次数
			'onepwd'			=>$onepwd,	// 个人管理密码
			'verify'			=>1		// 0 表示未审核  1 表示已通过审核
		);
		// 入jiaju_product表
		$this->load->model('product_model');
		$proid = $this->product_model->Productadd($vdata);
		// 入jiaju_pro_clas 表
		$this->load->model('proclass_model');
		$cdata = array(
			'proid'			=> $proid,
			'classid'		=> $classid
		);
		$this->proclass_model->Proclassadd($cdata);
		// 发送邮件
		$prourl = $this->data_config['base_header']."/home/show/1/$proid.html";
		if ($oneemail != '405503525@qq.com')
		$this->mail_user($onecontact,$proname,$prourl,$onepwd,$oneemail);
		$data =$this->data_config;
		redirect("/home/notice/0/$proid");
	}
	

// ------------------------------------------------------------------------

/**
	* 企业用户商铺
	*
	* Creates an anchor based on the local URL.
	*
	* @access	public
	* @param	string	the URL
	* @param	string	the link title
	* @param	mixed	any attributes
	* @return	string
*/
	public function shop($uid = '')
	{
		$data =$this->data_config;
		$this->load->view('shop/shop1_view',$data);
	
	}	

// ------------------------------------------------------------------------

/**
	* shoplist 
	*
	* 商家列表页.
	*
	* @access	public
	* @param	string	the URL
	* @param	string	the link title
	* @param	mixed	any attributes
	* @return	string
*/
	public function plist($uri = '')
	{
		$data =$this->data_config;
		$this->load->view('shop/shop1plist_view',$data);
	}


	

// ------------------------------------------------------------------------

/**
	* shopv
	*
	* 商家产品详细页.
	*
	* @access	public
	* @param	string	the URL
	* @param	string	the link title
	* @param	mixed	any attributes
	* @return	string
*/
	public function pv($uri = '')
	{
		$data =$this->data_config;
		$this->load->view('shop/shop1pv_view',$data);
	}



// ------------------------------------------------------------------------

/**
	* shoplistnews
	*
	* 企业新闻列表 .
	*
	* @access	public
	* @param	string	the URL
	* @param	string	the link title
	* @param	mixed	any attributes
	* @return	string
*/
	public function newslist($uri = '')
	{
		$data =$this->data_config;
		$this->load->view('shop/shop1newslist_view',$data);
	}



// ------------------------------------------------------------------------

/**
	* shopnewsv
	*
	* 新闻详细页 .
	*
	* @access	public
	* @param	string	the URL
	* @param	string	the link title
	* @param	mixed	any attributes
	* @return	string
*/
	public function newsv($uri = '')
	{
		$data =$this->data_config;
		$this->load->view('shop/shop1newsv_view',$data);
	}

// ------------------------------------------------------------------------

/**
	* shopnewsv
	*
	* 企业商铺中的单页 .
	*
*/
	public function onev($uri = '')
	{
		$data =$this->data_config;
		$this->load->view('shop/shop1onev_view',$data);
	}


	// ------------------------------------------------------------------------
	/**
		* 主站单页
	*/
	public function one($lmid=1)
	{
		$data =$this->data_config;
		$data['cbody'] = $lmid;
		$this->load->view('one_view',$data);
	
	}
	
	
	// ------------------------------------------------------------------------
	/**
		* notices 网页提示
	*/
	public function notice($classid='0',$proid='',$url='#')
	{
		$data =$this->data_config;
		$data['sid'] = $classid;
		$data['reurl'] = $url;
		$data['proid'] = $proid;
		$this->load->view('notice_view',$data);
	}
	
	/**
	 * 产看已经发布的信息列表
	 *
	 * @see		hislist()
	 * @author	Laurence.xu <haohailuo@163.com>
	 * @version	Tue Mar 08 23:05:33 CST 2011
	 * @param	<string> $mobile 手机号
	*/
	function hislist($mobile = '') {
		$lists = array();
		
		if (preg_match('/^(13|15|18|14)[0-9]{9}$/i', $mobile)) {
			$this->load->database();  //加载数据库
			
			$this->db->select('proid,probelong,proname,price,onetel,update');
			$this->db->where('onetel', $mobile);
			$this->db->order_by('update','desc');
			$query = $this->db->get("jiaju_product"); 
			$lists = $query->result_array();
			
			$query->free_result();
		}else {
			echo "手机号格式错误，请认真填写。";
			exit;
		}
		
		$data =$this->data_config;
		$data['list'] = $lists;
		$this->load->view('user/hisproduct', $data);
	}
	

}/* End of file home.php */
